home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / SHDK_2 / SHCLRDEF.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-30  |  21KB  |  533 lines

  1. {$I SHDEFINE.INC}
  2.  
  3. {$I SHUNITSW.INC}
  4.  
  5. {$D-,L-}
  6. unit ShClrdef;
  7. {
  8.                                 ShClrDef
  9.  
  10.                           A Screen Color Unit
  11.  
  12.                                    by
  13.  
  14.                               Bill Madison
  15.  
  16.                    W. G. Madison and Associates, Ltd.
  17.                           13819 Shavano Downs
  18.                             P.O. Box 780956
  19.                        San Antonio, TX 78278-0956
  20.                              (512)492-2777
  21.                              CIS 73240,342
  22.  
  23.                   Copyright 1991 Madison & Associates
  24.                           All Rights Reserved
  25.  
  26.         This file may  be used and distributed  only in accord-
  27.         ance with the provisions described on the title page of
  28.                   the accompanying documentation file
  29.                               SKYHAWK.DOC
  30. }
  31.  
  32. Interface
  33.  
  34. uses
  35.   TpWindow,
  36.   TpCrt;
  37.  
  38. const
  39.  
  40.         {Color constants:
  41.          Black     = 0; Blue   = 1; Green   = 2; Cyan   = 3; Red   = 4;
  42.          Magenta   = 5; Brown  = 6; LtGray  = 7;
  43.          DkGray    = 8; LtBlue = 9; LtGreen = A; LtCyan = B; LtRed = C;
  44.          LtMagenta = D; Yellow = E; White   = F
  45.          }
  46.  
  47.         {Screen color constants}
  48.         {Black text}                       {Blue text}
  49.         BlackOnBlack       = $00;          BlueOnBlack        = $01;
  50.         BlackOnBlue        = $10;          BlueOnBlue         = $11;
  51.         BlackOnGreen       = $20;          BlueOnGreen        = $21;
  52.         BlackOnCyan        = $30;          BlueOnCyan         = $31;
  53.         BlackOnRed         = $40;          BlueOnRed          = $41;
  54.         BlackOnMagenta     = $50;          BlueOnMagenta      = $51;
  55.         BlackOnBrown       = $60;          BlueOnBrown        = $61;
  56.         BlackOnLtGray      = $70;          BlueOnLtGray       = $71;
  57.  
  58.         {Green text}                       {Cyan text}
  59.         GreenOnBlack       = $02;          CyanOnBlack        = $03;
  60.         GreenOnBlue        = $12;          CyanOnBlue         = $13;
  61.         GreenOnGreen       = $22;          CyanOnGreen        = $23;
  62.         GreenOnCyan        = $32;          CyanOnCyan         = $33;
  63.         GreenOnRed         = $42;          CyanOnRed          = $43;
  64.         GreenOnMagenta     = $52;          CyanOnMagenta      = $53;
  65.         GreenOnBrown       = $62;          CyanOnBrown        = $63;
  66.         GreenOnLtGray      = $72;          CyanOnLtGray       = $73;
  67.  
  68.         {Red text}                         {Magenta text}
  69.         RedOnBlack         = $04;          MagentaOnBlack     = $05;
  70.         RedOnBlue          = $14;          MagentaOnBlue      = $15;
  71.         RedOnGreen         = $24;          MagentaOnGreen     = $25;
  72.         RedOnCyan          = $34;          MagentaOnCyan      = $35;
  73.         RedOnRed           = $44;          MagentaOnRed       = $45;
  74.         RedOnMagenta       = $54;          MagentaOnMagenta   = $55;
  75.         RedOnBrown         = $64;          MagentaOnBrown     = $65;
  76.         RedOnLtGray        = $74;          MagentaOnLtGray    = $75;
  77.  
  78.         {Brown text}                       {Light Gray text}
  79.         BrownOnBlack       = $06;          LtGrayOnBlack      = $07;
  80.         BrownOnBlue        = $16;          LtGrayOnBlue       = $17;
  81.         BrownOnGreen       = $26;          LtGrayOnGreen      = $27;
  82.         BrownOnCyan        = $36;          LtGrayOnCyan       = $37;
  83.         BrownOnRed         = $46;          LtGrayOnRed        = $47;
  84.         BrownOnMagenta     = $56;          LtGrayOnMagenta    = $57;
  85.         BrownOnBrown       = $66;          LtGrayOnBrown      = $67;
  86.         BrownOnLtGray      = $76;          LtGrayOnLtGray     = $77;
  87.  
  88.         {Dark Gray text}                   {Light Blue text}
  89.         DkGrayOnBlack      = $08;          LtBlueOnBlack      = $09;
  90.         DkGrayOnBlue       = $18;          LtBlueOnBlue       = $19;
  91.         DkGrayOnGreen      = $28;          LtBlueOnGreen      = $29;
  92.         DkGrayOnCyan       = $38;          LtBlueOnCyan       = $39;
  93.         DkGrayOnRed        = $48;          LtBlueOnRed        = $49;
  94.         DkGrayOnMagenta    = $58;          LtBlueOnMagenta    = $59;
  95.         DkGrayOnBrown      = $68;          LtBlueOnBrown      = $69;
  96.         DkGrayOnLtGray     = $78;          LtBlueOnLtGray     = $79;
  97.  
  98.         {Light Green Text}                 {Light Cyan text}
  99.         LtGreenOnBlack     = $0A;          LtCyanOnBlack      = $0B;
  100.         LtGreenOnBlue      = $1A;          LtCyanOnBlue       = $1B;
  101.         LtGreenOnGreen     = $2A;          LtCyanOnGreen      = $2B;
  102.         LtGreenOnCyan      = $3A;          LtCyanOnCyan       = $3B;
  103.         LtGreenOnRed       = $4A;          LtCyanOnRed        = $4B;
  104.         LtGreenOnMagenta   = $5A;          LtCyanOnMagenta    = $5B;
  105.         LtGreenOnBrown     = $6A;          LtCyanOnBrown      = $6B;
  106.         LtGreenOnLtGray    = $7A;          LtCyanOnLtGray     = $7B;
  107.  
  108.         {Light Red text}                   {Light Magenta text}
  109.         LtRedOnBlack       = $0C;          LtMagentaOnBlack   = $0D;
  110.         LtRedOnBlue        = $1C;          LtMagentaOnBlue    = $1D;
  111.         LtRedOnGreen       = $2C;          LtMagentaOnGreen   = $2D;
  112.         LtRedOnCyan        = $3C;          LtMagentaOnCyan    = $3D;
  113.         LtRedOnRed         = $4C;          LtMagentaOnRed     = $4D;
  114.         LtRedOnMagenta     = $5C;          LtMagentaOnMagenta = $5D;
  115.         LtRedOnBrown       = $6C;          LtMagentaOnBrown   = $6D;
  116.         LtRedOnLtGray      = $7C;          LtMagentaOnLtGray  = $7D;
  117.  
  118.         {Yellow text}                      {White text}
  119.         YellowOnBlack      = $0E;          WhiteOnBlack       = $0F;
  120.         YellowOnBlue       = $1E;          WhiteOnBlue        = $1F;
  121.         YellowOnGreen      = $2E;          WhiteOnGreen       = $2F;
  122.         YellowOnCyan       = $3E;          WhiteOnCyan        = $3F;
  123.         YellowOnRed        = $4E;          WhiteOnRed         = $4F;
  124.         YellowOnMagenta    = $5E;          WhiteOnMagenta     = $5F;
  125.         YellowOnBrown      = $6E;          WhiteOnBrown       = $6F;
  126.         YellowOnLtGray     = $7E;          WhiteOnLtGray      = $7F;
  127.  
  128. type
  129.   Orientation = (Vertical, Horizontal);
  130.  
  131. function SelectColors(Row, Col, BegAttr : byte;
  132.                       CpFrameChars      : FrameArray;
  133.                       Orient            : Orientation;
  134.                       ErasePanelOnExit,
  135.                       EraseCursorOnExit,
  136.                       WrapCursor        : boolean;
  137.                       Header  : string) : byte;
  138. {
  139.     *   Displays a 16x8 panel of text colors with the window coordinates
  140.         of the upper left corner at coordinates X=Col, Y=Row.
  141.     *   The attribute at which the cursor will be initially placed is
  142.         at BegAttr.
  143.     *   The color panel will be framed using the characters specified
  144.         in CpFrameChars.
  145.     *   Allows the user to navigate the panel with the arrow keys and
  146.         select the desired color combination by pressing <CR>. The user
  147.         can also press <INS>, which will return a function value of $FF,
  148.         and by convention, should be taken to indicate that the currently
  149.         selected attribute value is to be unchanged. Additionally, the
  150.         user can press <ESC>, returning a function value of $FE, which by
  151.         convention should be taken to indicate that the current color
  152.         selection run is completed. Finally, a return of $FD indicates
  153.         that the user has pressed the <F1> key either alone or in com-
  154.         bination with one of the shift-type keys (<L-SHIFT>, <R-SHIFT>,
  155.         <CTRL>, or <ALT>), and by convention indicates that the user is
  156.         requesting help.
  157.     *   ErasePanelOnExit determines whether the panel is erased or preserved
  158.         on the screen when SelectColors returns to the caller.
  159.         The panel is always disposed, and its heap space reclaimed.
  160.     *   EraseCursorOnExit is only effective if ErasePanelOnExit is false.
  161.         If the panel is to be preserved between calls to SelectColors,
  162.         EraseCursor determines whether the or not the cursor will continue
  163.         to be displayed along with the panel.
  164.     *   WrapCursor determines whether the cursor will wrap both horizontally
  165.         and vertically. True allows the cursor to wrap; False inhibits
  166.         further cursor movement when a window edge is reached.
  167.     *   Header is the header line which will be displayed on the panel. It
  168.         can be supplied as an empty string (''), in which case no header
  169.         will be displayed.
  170.     *   The function returns a normal text attribute byte, but with the
  171.         following exceptions:
  172.  
  173.     Return  Explanation
  174.     ------  -----------
  175.     $FF     <INS> was pressed by the user. Leave the current value
  176.             unchanged.
  177.     $FE     <ESC> was pressed by the user. Accept all current values
  178.             and consider the run completed.
  179.     $FD     <F1> was pressed by the user. Provide a HELP screen or
  180.             message.
  181.     $F0     Error in MakeWindow
  182.     $F1     Error in DisplayWindow
  183.  
  184. }
  185.  
  186. function ColorName(Attr  : byte) : string;
  187. {   Given a text attribute byte, ColorName returns the attribute color
  188.     name as defined above; e.g., ColorName($1E) will return 'YellowOnBlue'.
  189.     If a byte value is passed which does not correspond to a valid text
  190.     attribute, an empty string is returned.
  191. }
  192.  
  193. Implementation
  194.  
  195. function SelectColors(Row, Col, BegAttr : byte;
  196.                       CpFrameChars      :FrameArray;
  197.                       Orient            : Orientation;
  198.                       ErasePanelOnExit,
  199.                       EraseCursorOnExit,
  200.                       WrapCursor        : boolean;
  201.                       Header  : string) : byte;
  202.   type
  203.     DirectionType = (Up, Down, Left, Right);
  204.   var
  205.     NCols, NRows,
  206.     ColInc, RowInc: byte;
  207.     T1, T2        : integer;
  208.     C1            : char;
  209.     W1            : word;
  210.     WindowBuf     : pointer;
  211.     ColorPanel    : WindowPtr;
  212.     SavFrameChars : FrameArray;
  213.     EraseP        : boolean;
  214.   procedure MoveCursorBlock(Direction : DirectionType);
  215.     begin
  216.       FastWriteWindow(' X ', WhereY, WhereX, ReadAttrAtCursor);
  217.       case WrapCursor of
  218.         true  :
  219.           case Direction of
  220.             Down  : GoToXY(WhereX, (WhereY mod NRows) + 1);
  221.             Up    : GoToXY(WhereX, NRows - ((RowInc - WhereY) mod NRows));
  222.             Left  : GoToXY((WhereX-3 + (3*NCols)) mod (3*NCols), WhereY);
  223.             Right : GoToXY((WhereX+3 + (3*NCols)) mod (3*NCols), WhereY);
  224.             end; {case Direction}
  225.         false :
  226.           case Direction of
  227.             Down  : GoToXY(WhereX, WhereY+1);
  228.             Up    : GoToXY(WhereX, WhereY-1);
  229.             Left  : GoToXY(WhereX-3, WhereY);
  230.             Right : GoToXY(WhereX+3, WhereY);
  231.             end; {case Direction}
  232.         end; {case WrapCursor}
  233.       FastWriteWindow('[X]', WhereY, WhereX, ReadAttrAtCursor);
  234.       end; {MoveCursorBlock}
  235.   begin {SelectColors}
  236.     {Calculate window dimensions based on orientation}
  237.     case Orient of
  238.       Vertical    : begin
  239.         NCols := 8;
  240.         NRows := 16;
  241.         end;
  242.       Horizontal  : begin
  243.         NCols := 16;
  244.         NRows := 8;
  245.         end;
  246.       end; {case Orient}
  247.     ColInc := 3 * NCols + 1;
  248.     RowInc := NRows + 1;
  249.  
  250.     {Check position parameters}
  251.     if Row = 0 then
  252.       Row := (ScreenHeight - RowInc) shr 1;
  253.     if Col = 0 then
  254.       Col := (ScreenWidth - ColInc) shr 1;
  255.     if (Row+RowInc > ScreenHeight) then
  256.       Row := ScreenHeight - RowInc;
  257.     if (Col+ColInc > ScreenWidth) then
  258.       Col := ScreenWidth - ColInc;
  259.  
  260.     {General housekeeping}
  261.     HiddenCursor;
  262.     SavFrameChars := FrameChars;
  263.  
  264.     {Set frame as specified in call}
  265.     FrameChars := CpFrameChars;
  266.  
  267.     {Build the color panel}
  268.     if not MakeWindow(ColorPanel, Col, Row, Col+ColInc, Row+RowInc,
  269.                   true, false, false,
  270.                   $07, $07, $07, Header) then begin
  271.       SelectColors := $F0;
  272.       NormalCursor;
  273.       FrameChars := SavFrameChars;
  274.       exit;
  275.       end;
  276.     if not DisplayWindow(ColorPanel) then begin
  277.       SelectColors := $F1;
  278.       NormalCursor;
  279.       FrameChars := SavFrameChars;
  280.       exit;
  281.       end;
  282.     for T1 := 0 to NRows-1 do
  283.       for T2 := 0 to NCols-1 do
  284.         case Orient of
  285.           Vertical    : FastWriteWindow
  286.                           (' X ', T1+1, 3*T2+1, ((T2 shl 4) + T1));
  287.           Horizontal  : FastWriteWindow
  288.                           (' X ', T1+1, 3*T2+1, ((T1 shl 4) + T2));
  289.           end; {case Orient}
  290.  
  291.     {Place the cursor as specified in call}
  292.     case Orient of
  293.       Vertical    : GoToXY(3*(BegAttr shr 4)+1, (BegAttr and $0F)+1);
  294.       Horizontal  : GoToXY(3*(BegAttr and $0F)+1, (BegAttr shr 4)+1);
  295.       end;
  296.     FastWriteWindow('[X]',WhereY, WhereX,ReadAttrAtCursor);
  297.  
  298.     {Select the desired color attribute}
  299.     repeat
  300.       W1 := ReadKeyWord;
  301.       case W1 of
  302.         $4800:  begin                       {UpArrow}
  303.                   MoveCursorBlock(Up);
  304.                   end;
  305.         $4B00:  begin                       {LtArrow}
  306.                   MoveCursorBlock(Left);
  307.                   end;
  308.         $4D00:  begin                       {RtArrow}
  309.                   MoveCursorBlock(Right);
  310.                   end;
  311.         $5000:  begin                       {DnArrow}
  312.                   MoveCursorBlock(Down);
  313.                   end;
  314.         end; {case}
  315.       until (W1 = $1C0D {<CR >}) or
  316.             (W1 = $5200 {<INS>}) or
  317.             (W1 = $011B {<ESC>}) or
  318.             (W1 = $3B00 {<F1> }) or
  319.             (W1 = $5400 {<#F1>}) or
  320.             (W1 = $5E00 {<^F1>}) or
  321.             (W1 = $6800 {<@F1>});
  322.  
  323.     {Conditionally save the panel}
  324.     case ErasePanelOnExit of
  325.       false :
  326.         {Conditionally clear the cursor block after selection}
  327.         begin
  328.           case EraseCursorOnExit of
  329.             false : {Do nothing}  ;
  330.             true  :
  331.               begin
  332.                 FastWriteWindow(' X ',WhereY, WhereX, ReadAttrAtCursor);
  333.                 end;
  334.             end; {case EraseCursorOnExit}
  335.           if SaveWindow
  336.             (Col, Row, Col+ColInc, Row+RowInc, true, WindowBuf) then ;
  337.           end; {false}
  338.       true  : {Do nothing}  ;
  339.       end; {case ErasePanelOnExit}
  340.  
  341.     {Set up the return}
  342.     case W1 of
  343.       $5200 {<INS>} : SelectColors := $FF;
  344.       $011B {<ESC>} : SelectColors := $FE;
  345.       $3B00,{<F1> }
  346.       $5400,{<#F1>}
  347.       $5E00,{<^F1>}
  348.       $6800 {<@F1>} : SelectColors := $FD;
  349.       else            begin
  350.                         byte(C1) := ReadAttrAtCursor;
  351.                         SelectColors := byte(C1);
  352.                         end;
  353.       end; {case W1}
  354.  
  355.     {Dispose of the window and conditionally restore the panel}
  356.     DisposeWindow(EraseTopWindow);
  357.     if not ErasePanelOnExit then
  358.       RestoreWindow(Col, Row, Col+ColInc, Row+RowInc, true, WindowBuf);
  359.  
  360.     {Restore the environment and scram}
  361.     NormalCursor;
  362.     FrameChars := SavFrameChars;
  363.    end;
  364.  
  365. function ColorName(Attr  : byte) : string;
  366.   begin
  367.     case Attr of
  368.  
  369.       {Black text}
  370.       $00 : ColorName := 'BlackOnBlack';
  371.       $10 : ColorName := 'BlackOnBlue';
  372.       $20 : ColorName := 'BlackOnGreen';
  373.       $30 : ColorName := 'BlackOnCyan';
  374.       $40 : ColorName := 'BlackOnRed';
  375.       $50 : ColorName := 'BlackOnMagenta';
  376.       $60 : ColorName := 'BlackOnBrown';
  377.       $70 : ColorName := 'BlackOnLtGray';
  378.  
  379.             {Blue text}
  380.       $01 : ColorName := 'BlueOnBlack';
  381.       $11 : ColorName := 'BlueOnBlue';
  382.       $21 : ColorName := 'BlueOnGreen';
  383.       $31 : ColorName := 'BlueOnCyan';
  384.       $41 : ColorName := 'BlueOnRed';
  385.       $51 : ColorName := 'BlueOnMagenta';
  386.       $61 : ColorName := 'BlueOnBrown';
  387.       $71 : ColorName := 'BlueOnLtGray';
  388.  
  389.             {Green text}
  390.       $02 : ColorName := 'GreenOnBlack';
  391.       $12 : ColorName := 'GreenOnBlue';
  392.       $22 : ColorName := 'GreenOnGreen';
  393.       $32 : ColorName := 'GreenOnCyan';
  394.       $42 : ColorName := 'GreenOnRed';
  395.       $52 : ColorName := 'GreenOnMagenta';
  396.       $62 : ColorName := 'GreenOnBrown';
  397.       $72 : ColorName := 'GreenOnLtGray';
  398.  
  399.             {Cyan text}
  400.       $03 : ColorName := 'CyanOnBlack';
  401.       $13 : ColorName := 'CyanOnBlue';
  402.       $23 : ColorName := 'CyanOnGreen';
  403.       $33 : ColorName := 'CyanOnCyan';
  404.       $43 : ColorName := 'CyanOnRed';
  405.       $53 : ColorName := 'CyanOnMagenta';
  406.       $63 : ColorName := 'CyanOnBrown';
  407.       $73 : ColorName := 'CyanOnLtGray';
  408.  
  409.             {Red text}
  410.       $04 : ColorName := 'RedOnBlack';
  411.       $14 : ColorName := 'RedOnBlue';
  412.       $24 : ColorName := 'RedOnGreen';
  413.       $34 : ColorName := 'RedOnCyan';
  414.       $44 : ColorName := 'RedOnRed';
  415.       $54 : ColorName := 'RedOnMagenta';
  416.       $64 : ColorName := 'RedOnBrown';
  417.       $74 : ColorName := 'RedOnLtGray';
  418.  
  419.             {Magenta text}
  420.       $05 : ColorName := 'MagentaOnBlack';
  421.       $15 : ColorName := 'MagentaOnBlue';
  422.       $25 : ColorName := 'MagentaOnGreen';
  423.       $35 : ColorName := 'MagentaOnCyan';
  424.       $45 : ColorName := 'MagentaOnRed';
  425.       $55 : ColorName := 'MagentaOnMagenta';
  426.       $65 : ColorName := 'MagentaOnBrown';
  427.       $75 : ColorName := 'MagentaOnLtGray';
  428.  
  429.             {Brown text}
  430.       $06 : ColorName := 'BrownOnBlack';
  431.       $16 : ColorName := 'BrownOnBlue';
  432.       $26 : ColorName := 'BrownOnGreen';
  433.       $36 : ColorName := 'BrownOnCyan';
  434.       $46 : ColorName := 'BrownOnRed';
  435.       $56 : ColorName := 'BrownOnMagenta';
  436.       $66 : ColorName := 'BrownOnBrown';
  437.       $76 : ColorName := 'BrownOnLtGray';
  438.  
  439.             {Light Gray text}
  440.       $07 : ColorName := 'LtGrayOnBlack';
  441.       $17 : ColorName := 'LtGrayOnBlue';
  442.       $27 : ColorName := 'LtGrayOnGreen';
  443.       $37 : ColorName := 'LtGrayOnCyan';
  444.       $47 : ColorName := 'LtGrayOnRed';
  445.       $57 : ColorName := 'LtGrayOnMagenta';
  446.       $67 : ColorName := 'LtGrayOnBrown';
  447.       $77 : ColorName := 'LtGrayOnLtGray';
  448.  
  449.             {Dark Gray text}
  450.       $08 : ColorName := 'DkGrayOnBlack';
  451.       $18 : ColorName := 'DkGrayOnBlue';
  452.       $28 : ColorName := 'DkGrayOnGreen';
  453.       $38 : ColorName := 'DkGrayOnCyan';
  454.       $48 : ColorName := 'DkGrayOnRed';
  455.       $58 : ColorName := 'DkGrayOnMagenta';
  456.       $68 : ColorName := 'DkGrayOnBrown';
  457.       $78 : ColorName := 'DkGrayOnLtGray';
  458.  
  459.             {Light Blue text}
  460.       $09 : ColorName := 'LtBlueOnBlack';
  461.       $19 : ColorName := 'LtBlueOnBlue';
  462.       $29 : ColorName := 'LtBlueOnGreen';
  463.       $39 : ColorName := 'LtBlueOnCyan';
  464.       $49 : ColorName := 'LtBlueOnRed';
  465.       $59 : ColorName := 'LtBlueOnMagenta';
  466.       $69 : ColorName := 'LtBlueOnBrown';
  467.       $79 : ColorName := 'LtBlueOnLtGray';
  468.  
  469.             {Light Green Text}
  470.       $0A : ColorName := 'LtGreenOnBlack';
  471.       $1A : ColorName := 'LtGreenOnBlue';
  472.       $2A : ColorName := 'LtGreenOnGreen';
  473.       $3A : ColorName := 'LtGreenOnCyan';
  474.       $4A : ColorName := 'LtGreenOnRed';
  475.       $5A : ColorName := 'LtGreenOnMagenta';
  476.       $6A : ColorName := 'LtGreenOnBrown';
  477.       $7A : ColorName := 'LtGreenOnLtGray';
  478.  
  479.             {Light Cyan text}
  480.       $0B : ColorName := 'LtCyanOnBlack';
  481.       $1B : ColorName := 'LtCyanOnBlue';
  482.       $2B : ColorName := 'LtCyanOnGreen';
  483.       $3B : ColorName := 'LtCyanOnCyan';
  484.       $4B : ColorName := 'LtCyanOnRed';
  485.       $5B : ColorName := 'LtCyanOnMagenta';
  486.       $6B : ColorName := 'LtCyanOnBrown';
  487.       $7B : ColorName := 'LtCyanOnLtGray';
  488.  
  489.             {Light Red text}
  490.       $0C : ColorName := 'LtRedOnBlack';
  491.       $1C : ColorName := 'LtRedOnBlue';
  492.       $2C : ColorName := 'LtRedOnGreen';
  493.       $3C : ColorName := 'LtRedOnCyan';
  494.       $4C : ColorName := 'LtRedOnRed';
  495.       $5C : ColorName := 'LtRedOnMagenta';
  496.       $6C : ColorName := 'LtRedOnBrown';
  497.       $7C : ColorName := 'LtRedOnLtGray';
  498.  
  499.             {Light Magenta text}
  500.       $0D : ColorName := 'LtMagentaOnBlack';
  501.       $1D : ColorName := 'LtMagentaOnBlue';
  502.       $2D : ColorName := 'LtMagentaOnGreen';
  503.       $3D : ColorName := 'LtMagentaOnCyan';
  504.       $4D : ColorName := 'LtMagentaOnRed';
  505.       $5D : ColorName := 'LtMagentaOnMagenta';
  506.       $6D : ColorName := 'LtMagentaOnBrown';
  507.       $7D : ColorName := 'LtMagentaOnLtGray';
  508.  
  509.             {Yellow text}
  510.       $0E : ColorName := 'YellowOnBlack';
  511.       $1E : ColorName := 'YellowOnBlue';
  512.       $2E : ColorName := 'YellowOnGreen';
  513.       $3E : ColorName := 'YellowOnCyan';
  514.       $4E : ColorName := 'YellowOnRed';
  515.       $5E : ColorName := 'YellowOnMagenta';
  516.       $6E : ColorName := 'YellowOnBrown';
  517.       $7E : ColorName := 'YellowOnLtGray';
  518.  
  519.             {White text}
  520.       $0F : ColorName := 'WhiteOnBlack';
  521.       $1F : ColorName := 'WhiteOnBlue';
  522.       $2F : ColorName := 'WhiteOnGreen';
  523.       $3F : ColorName := 'WhiteOnCyan';
  524.       $4F : ColorName := 'WhiteOnRed';
  525.       $5F : ColorName := 'WhiteOnMagenta';
  526.       $6F : ColorName := 'WhiteOnBrown';
  527.       $7F : ColorName := 'WhiteOnLtGray';
  528.  
  529.       else  ColorName := '';
  530.       end;
  531.     end;
  532.   end.
  533.